# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-click-didyoumean
pkgver=0.3.0
pkgrel=2
pkgdesc="Enable git-like did-you-mean feature in click"
url="https://github.com/click-contrib/click-didyoumean"
license=('MIT')
arch=('any')
depends=('python-click')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest')
source=("https://github.com/click-contrib/click-didyoumean/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('4927ee392f27950c3f7ef5e0f1d5a5e2421172f3e9d34ec76986c9c7ea698cfa1981678a06fb8682577d6ed04c242c42bdd1d796d7623a1c99dfdbdb61c80fca')

build() {
  cd click-didyoumean-$pkgver
  python -m build -nw
}

check() {
  cd click-didyoumean-$pkgver
  PYTHONPATH="$PWD/src" pytest
}

package() {
  cd click-didyoumean-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
